import request from '@/config/axios'

export interface DesignCompleteTicketVO {
  id: number
  event: string
  designCompletionNumber: string
  taskNumber: string
  productType: string
  productNumber: string
  partName: string
  dictDrawingType: string
  drawingContent: string
  changeContent: string
  remark: string
  dictTicketStatus: number
  proofreaderOpinion: string
  proofreader: string
  proofreaderName: string
  proofreaderTime: string
  approverOpinion: string
  approver: string
  approverTime: string
  ratifyResult: string
  ratifior: string
  ratifyTime: Date
  customerCode: string
  productStandard: string
  dictTaskCompleteStatus: number
  process: number
  productDrawingNumber: string
}
//查询发布任务单列表
export const getDesignCompleteTicketReleasePage = async (params) => {
  return await request.get({ url: `/technology/design-complete-ticket/release/page`, params })
}
// 查询设计完工单列表
export const getDesignCompleteTicketPage = async (params) => {
  return await request.get({ url: `/technology/design-complete-ticket/page`, params })
}

// 查询设计完工单详情
export const getDesignCompleteTicket = async (id: number) => {
  return await request.get({ url: `/technology/design-complete-ticket/get?id=` + id })
}

// 新增设计完工单
export const createDesignCompleteTicket = async (data: DesignCompleteTicketVO) => {
  return await request.post({ url: `/technology/design-complete-ticket/create`, data })
}

// 修改设计完工单
export const updateDesignCompleteTicket = async (data: DesignCompleteTicketVO) => {
  return await request.put({ url: `/technology/design-complete-ticket/update`, data })
}

// 提交设计完工单
export const handleDesignCompleteTicket = async (data: DesignCompleteTicketVO) => {
  return await request.post({ url: `/technology/design-complete-ticket/commit`, data })
}

// 删除设计完工单
export const deleteDesignCompleteTicket = async (id: number) => {
  return await request.delete({ url: `/technology/design-complete-ticket/delete?id=` + id })
}

// 导出设计完工单 Excel
export const exportDesignCompleteTicket = async (data) => {
  return await request.download({ url: `/technology/design-complete-ticket/release/export-excel`, data })
}

// 确认发布任务单
export const releaseCompleteTicket = async (data) => {
  return await request.post({ url: `/technology/design-complete-ticket/release`, data })
}

// 下载设计完工单图纸清单模板
export const downloadDrawingListTemplate = async () => {
  return await request.download({ url: `/technology/ticket-drawing/get-import-template` })
}

// 查询图纸清单
export const getDrawingList = async (params) => {
  return await request.get({ url: `/technology/ticket-drawing/page`, params })
}

// 删除图纸清单行
export const deleteDrawing = async (id: number) => {
  return await request.delete({ url: `/technology/ticket-drawing/delete?id=${id}`,  })
}

// 导出图纸清单excel
export const exportDesignDrawing = async (params) => {
  return await request.download({ url: `/technology/ticket-drawing/export-excel`, params })
}